/**
 * Created by JetBrains PhpStorm.
 * User: September5th
 * Date: 3/11/12
 * Time: 1:50 AM
 * To change this template use File | Settings | File Templates.
 */

Ext.define('EM.view.folder.FolderTree', {

    extend:'Ext.panel.Panel',

    initComponent:function () {

        Ext.applyIf(this, {
            layout:{
                type:'border'
            },
            items:[
                {
                    xtype:'textfield',
                    id:'folders-search-textfield',
                    labelWidth:30,
                    emptyText:'Search folder...',
                    region:'north',
                    enableKeyEvents:true
                },
                {
                    xtype:'treepanel',
                    animCollapse:false,
                    preventHeader:true,
                    store:'Folders',
                    useArrows:true,
                    region:'center',
                    multiSelect:true,
                    id:'folders-treeview',
                    rootVisible:false,

                    viewConfig:{
                        allowCopy:true,
                        plugins:[
                            {
                                ptype:'treeviewdragdrop',
                                appendOnly:true,
                                dragText:'{0} selected folder{1}'
                            }
                        ],
                        toggleOnDblClick:false
                    },
                    plugins:[
                        Ext.create('Ext.grid.plugin.CellEditing', {
                            clicksToEdit:1
                        })
                    ]

                }
            ]
        });

        this.callParent(arguments);
    }
});
